<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component">
<h:head>
	<ice:outputStyle href="#{baseMBean.securedOutPutStyleURL}"></ice:outputStyle>
</h:head>
<h:body class="#{baseMBean.securedOutPutBodyClass}">
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_common"
		var="msgs_common"></f:loadBundle>
	<f:loadBundle
		basename="com/avecsys/quotemanager/resources/messages_supplier"
		var="msgs_supplier"></f:loadBundle>
	<c:if test="${baseMBean.menuBarEnabled == 'true'}">
		<h:form id="menuBarForm">
			<icecore:singleSubmit />
			<ice:menuBar styleClass="menuBar">
		        <ice:menuItems value="#{menuBarMBean.menuModel}"/>
		    </ice:menuBar>
	    </h:form>		
	</c:if>
	<h:form id="form">
		<f:event listener="#{loginMBean.isUserSignedIn}" type="preRenderView"></f:event>
		<div class="page-container">
			<div class="pageHeader">
				<ice:panelGrid columns="2">
					<ice:graphicImage
						url="#{quoteEventReplyListMBean.getImageResourceURL('PAGE_HEADER_ICON_SUPPLIER_INQUIRY')}"></ice:graphicImage>
					<ice:outputLabel
						value="#{msgs_supplier.LIST_OF_SENT_QUOTES_ALL_INQUIRY_HEADER_SECTION_TITLE}"
						styleClass="pageHeaderTitleText"></ice:outputLabel>
				</ice:panelGrid>
			</div>
			<center>
				<ace:dataTable id="supplierReplyQuoteEventHistoryTableID"
					value="#{quoteEventReplyListMBean.quoteTransactionEventsPojoList}"
					var="quoteTransactionEventsPojo" paginator="true" rows="10"
					paginatorPosition="bottom"
					emptyMessage="#{msgs_common.DATATABLE_EMPTY_MESSAGE}">
					<ace:column id="addressLine1Id" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.buyerMasterPojo.companyMasterPojo.companyName}"
						filterBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.buyerMasterPojo.companyMasterPojo.companyName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_BUYER_COMPANY}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.quoteTransactionPojo.buyerMasterPojo.companyMasterPojo.companyName}" />
					</ace:column>
					<ace:column id="companyNameId" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
						filterBy="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_QUOTE_NAME}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}" />
					</ace:column>
					<ace:column id="quoteValueId" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.quoteValue}"
						filterBy="#{quoteTransactionEventsPojo.quoteValue}"
						filterMatchMode="contains" style="text-align:right;">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_QUOTE_VALUE}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{quoteTransactionEventsPojo.quoteValue}">
							<f:convertNumber minFractionDigits="2" />
						</ice:outputText>
					</ace:column>
					<ace:column id="sellerCommentsID" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.sellerComments}"
						filterBy="#{quoteTransactionEventsPojo.sellerComments}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_SELLER_COMMENTS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteTransactionEventsPojo.sellerComments}" />
					</ace:column>
					<ace:column id="buyerCommentsID" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.buyerComments}"
						filterBy="#{quoteTransactionEventsPojo.buyerComments}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_BUYER_COMMENTS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText value="#{quoteTransactionEventsPojo.buyerComments}" />
					</ace:column>
					<ace:column id="addressLine2Id" styleClass="tr1"
						sortBy="#{quoteTransactionEventsPojo.transactionStatus}"
						filterBy="#{quoteEventReplyListMBean.decodeTransactionStatus(quoteTransactionEventsPojo.transactionStatus)}"
						filterMatchMode="contains">
						<f:facet name="header">
							<ice:outputText
								value="#{msgs_supplier.SUPPLIER_QUOTE_LIST_HEADER_TRANSACTION_STATUS}"
								styleClass="tdheader" />
						</f:facet>
						<ice:outputText
							value="#{quoteEventReplyListMBean.decodeTransactionStatus(quoteTransactionEventsPojo.transactionStatus)}" />
					</ace:column>
					<ace:column id="edit" styleClass="tr1">
						<f:facet name="header">
							<ice:outputText value="#{commonMsgs.TABLE_HEADER_ACTION}"
								styleClass="tdheader" />
						</f:facet>
						<ui:fragment
							rendered="#{quoteTransactionEventsPojo.transactionStatus == '02'}">
							<ice:commandLink
								actionListener="#{quoteEventReplyListMBean.actionShowModifyQuoteDialog}">
								<f:param value="#{quoteTransactionEventsPojo.eventId}"
									name="eventId" />
								<f:param
									value="#{quoteTransactionEventsPojo.quoteTransactionPojo.quoteName}"
									name="quoteName" />
								<ice:graphicImage
									url="#{quoteEventReplyListMBean.getImageResourceURL('IMG_AMEND_QUOTE_ICON')}"
									title="#{msgs_supplier.TOOLTIP_ACTION_MODIFY_QUOTE}"
									style="border-left:0px;border-right:0px;border-top:0px;border-bottom:0px" />
							</ice:commandLink>
						</ui:fragment>
					</ace:column>
				</ace:dataTable>
			</center>
			<center>
				<div>
					<ice:commandButton value="#{msgs_common.COMMAND_ACTION_BACK}"
						immediate="true" action="#{quoteEventReplyListMBean.actionBack}"
						styleClass="color green button"></ice:commandButton>
				</div>
			</center>
		</div>
		<br />
		<ace:confirmationDialog id="messageDialog"
			widgetVar="#{quoteEventReplyListMBean.messageDialog.dialogWidgetVar}"
			message="#{quoteEventReplyListMBean.messageDialog.message}"
			header="Confirmation" width="400" height="180" closable="true"
			position="center" modal="true">
			<center>
				<ice:panelGrid columns="1">
					<ice:outputLabel
						value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_COMMENTS}" />
					<ice:inputTextarea
						value="#{quoteEventReplyListMBean.buyerComments}" rows="10"
						cols="40"></ice:inputTextarea>
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<ice:commandButton id="yes"
						value="#{msgs_common.COMMAND_ACTION_YES}"
						actionListener="#{quoteEventReplyListMBean.actionApproveOrAmendOrIgnoreQuote}"
						styleClass="small color green button">
					</ice:commandButton>
					<ice:commandButton id="no" value="#{msgs_common.COMMAND_ACTION_NO}"
						actionListener="#{quoteEventReplyListMBean.messageDialog.hideDialog}"
						styleClass="small color green button" />
					<ice:inputHidden name="requestJSON"
						value="#{quoteEventReplyListMBean.messageDialog.requestJSON}"></ice:inputHidden>
				</ice:panelGrid>
			</center>
		</ace:confirmationDialog>
		<ui:include src="/assets/pages/core/messageBoard.xhtml"></ui:include>
	</h:form>
	<h:form id="quoteModifyFormID">
		<ace:dialog id="quoteModifyDialogID"
			widgetVar="#{quoteEventReplyListMBean.quoteModifyDialog.dialogId}"
			header="#{msgs_supplier.DIALOG_QUOTE_MODIFY_HEADER_TITLE}"
			closable="true" position="center" modal="true">
			<center>
				<ice:panelGrid columns="2">
					<ice:outputLabel
						value="#{msgs_supplier.DIALOG_QUOTE_REPLY_MODIFY_NEW_QUOTE_VALUE}" />
					<h:inputText
						value="#{quoteEventReplyListMBean.quoteModifyDialog.newQuoteValue}">
						<f:convertNumber minFractionDigits="2" />
					</h:inputText>
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<ice:outputLabel
						value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_COMMENTS}" />
					<ice:inputTextarea id="commentsID"
						binding="#{quoteEventReplyListMBean.quoteModifyDialog.widgetComments}"
						value="#{quoteEventReplyListMBean.quoteModifyDialog.comments}"
						rows="10" cols="40" required="true" immediate="true">
						<f:validateRequired />
						<f:validateLength minimum="1"></f:validateLength>
					</ice:inputTextarea>
					<span class="fieldMessage"><ice:message
							styleClass="iceMsgError" style="color:red;" for="commentsID" /></span>
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<ice:outputLabel
						value="#{msgs_supplier.DIALOG_QUOTE_REPLY_MODIFY_EXISTING_QUOTE}" />
					<ice:selectBooleanCheckbox id="needToModifyID" immediate="true"
						partialSubmit="true"
						value="#{quoteEventReplyListMBean.quoteModifyDialog.modifyExistingQuoteAttachment}"
						binding="#{quoteEventReplyListMBean.quoteModifyDialog.widgetModifyExistingQuoteAttachment}"
						valueChangeListener="#{quoteEventReplyListMBean.quoteModifyDialog.actionModifyExistingQuoteAttachment}"></ice:selectBooleanCheckbox>
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<ice:outputLabel
						value="#{msgs_supplier.SEND_QUOTE_TO_BUYER_FORM_ATTACH_QUOTE}" />
					<ace:fileEntry id="fileAttachmentId"
						disabled="#{quoteEventReplyListMBean.quoteModifyDialog.quoteAttachmentDisabled}"
						immediateValidation="true" maxFileCount="1" immediate="true"
						fileEntryListener="#{quoteEventReplyListMBean.quoteModifyDialog.actionQuoteAttachmentListener}"
						maxFileSize="6291456"
						maxFileSizeMessage="Submitted file is too large."
						requiredMessage="The file is required to submit this form."
						required="#{quoteEventReplyListMBean.quoteModifyDialog.modifyExistingQuoteAttachment}" />
					<ice:message styleClass="iceMsgError" style="color:red;"
						for="fileAttachmentId" />
				</ice:panelGrid>
				<ice:panelGrid columns="3">
					<h:commandButton id="send"
						value="#{msgs_common.COMMAND_ACTION_SEND}"
						action="#{quoteEventReplyListMBean.actionCreateModifyEvent}"
						styleClass="small color green button">
					</h:commandButton>
					<h:commandButton id="cancel" immediate="true"
						value="#{msgs_common.COMMAND_ACTION_CANCEL}"
						actionListener="#{quoteEventReplyListMBean.quoteModifyDialog.hideDialog}"
						styleClass="small color green button" />
					<ice:inputHidden name="requestJSON"
						value="#{quoteEventReplyListMBean.quoteModifyDialog.requestJSON}"></ice:inputHidden>
				</ice:panelGrid>
			</center>
		</ace:dialog>
	</h:form>
</h:body>
</html>
